À la fin de ce chapitre, vous
Animation montrant la progression du jeu de données Datasaurus pour toutes les formes visées. Source: Same Stats, Different Graphs: Generating Datasets with Varied Appearance and Identical Statistics through Simulated Annealing.
## ── Attaching packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.2.1 ──
## ✔ ggplot2 3.1.0 ✔ purrr 0.3.0
## ✔ tibble 2.0.1 ✔ dplyr 0.7.8
## ✔ tidyr 0.8.2 ✔ stringr 1.3.1
## ✔ readr 1.3.1 ✔ forcats 0.3.0
## ── Conflicts ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
nasa_temp <- read_tsv("https://climate.nasa.gov/system/internal_resources/details/original/647_Global_Temperature_Data_File.txt",
col_names = c('year', 'temp', 'loess'))## Parsed with column specification:
## cols(
## year = col_double(),
## temp = col_double(),
## loess = col_double()
## )
nasa_temp %>%
#filter(year >= 1998 & year <= 2008) %>%
ggplot(mapping = aes(x = year, y = temp)) +
geom_line() Source: Slidebazaar
market <- tibble(category = c("Creative Design", "Desktop Application", "Commercial Print Ad", "Mobile App Design"), proportion = c(16, 24, 10, 50))
market %>%
ggplot(mapping = aes(x = fct_reorder(category, proportion), y = proportion)) + geom_col() + labs(x = "", y = "Proportion") + coord_flip()library("ggthemr")
ggthemr(palette = "dust", layout = "scientific", type = "outer")
market %>%
ggplot(mapping = aes(x = fct_reorder(category, proportion), y = proportion)) + geom_col() + labs(x = "", y = "Proportion") + coord_flip() Source: Messerli, (2012)
Impérative. Comment placer l’information sur une canevas. Exemple: R-base, Matplotlib (Python), Excel.
Déclarative. Spécifier quoi afficher. Exemple: ggplot2, altair (Python).
La visualisation déclarative vous permet de penser aux données et à leurs relations, plutôt que des détails accessoires.
Jake Vanderplas, Declarative Statistical Visualization in Python with Altair (ma traduction)
–> basculer vers les notes de cours.
–> basculer vers les notes de cours.